package com.huixue.cn.ztej.utils;

public class RandomUtil {
	private static  String str = "ABCDEFJHJKLMNPQRSTUVWXYZabcdefjhijkmnpqrstuvwxyz23456789";
	
	public static String makeRandomString(int length){
		StringBuffer m = new StringBuffer();
		java.util.Random random =new java.util.Random(); 
		for(int i = 0;i<length;i++){
			char chart = str.charAt(random.nextInt(str.length()));
			if(m.toString().contains(chart+"")){
				i--;
			}else{
				m.append(chart);
			}
			
		}
		return m.toString();
	}
	
	public static void main(String[] args) {
		System.out.println(makeRandomString(4));
		
		System.out.println(Long.toHexString(System.currentTimeMillis()));
	}
}
